"Top Broker" by 5ace
--------------------

"PUR-80", Commodore64, Microsoft BASIC V2



Story:
------

As a successful businessman you have reached and implemented all your financial dreams in life.
However, your business partners have cheated and exploited you and set you a trap.
You've lost everything you ever owned.
Equipped with an old PC and 10000 borrowed monetary units from the mafia,
you as a top broker see only one chance to retaliate: the trading floor.





Instructions:
-------------

The display shows your set goal for the trading day, how much time you have left until the trading day ends (first day has 60 seconds),
the actual price for one share, the amount of money you have and the number of shares you posses. 
 
Use cursor right to buy shares.
Use cursor left to sell shares.

The goal is to exceed the displayed goal that is set for you. 

You have to buy on a low price and sell on a higher one.
Be aware that you loose the game if you declare to sell shares you don't own or
you declare to buy shares with money you don't have.

In this case or if you don't achieve your set goal you have to start all over at goal-level 101% again.

When a trading day ends, only your cash-value is important, not the amount of your shares.

Each day you pass succesfully, your goal is increased by 1% and your available time decreased by 5 seconds.

Press a key to restart the game when it is over.




How to start this game in the emulator:
---------------------------------------
1.) Download "vice" emulator from http://vice-emu.sourceforge.net/
2.) Execute "vice" and Drag and Drop "Top Broker.prg" into the "vice" window.
This will autostart the game.

Alternatively select "File"->"Autostart Disk/Tape Image" from the menu.
Select the file "Top Broker.prg" and click on attach.



Code:
-------------

0 m=0:DIMn$(10):fori=0to10:readn$(i):nexti:poke53280,0:poke53281,0:poke646,5:l=100
1 l=l+1:x=l-100:a=200:t=abs(480-(x*40)):g=10000:b=0:?"{clear}":d=30:e=15:g$="{home}goal"
2 ?g$,l"%":?n$(3),int(t/8):?n$(4),a:?n$(5),g:?n$(6),b:?n$(m):a=abs(a+INT(RND(1)*d)-e)
3 geta$:m=1+(a$="{left}")-(a$="{right}"):g=g-(m-1)*a:b=b+(m-1):ifb<0ORg<0thenl=100:j=7:goto7
4 t=t-1:ifint(t/8)*8=tthen?"{clear}"
5 ift>0thengoto2:data"{return}{reverse on}sell","{return}{reverse on}wait","{return}{reverse on}buy ","time"
6 p=(g/100):?"result: "p"%":j=10+(p<l):ifp<lthenl=100:data"price","cash","shares"
7 ?n$(j):?n$(8):poke198,0:wait198,1:goto1:data"you go to jail for fraud!"
8 data"press a key to start","you loose - the mafia is killing you"
9 data"you win - you paid everything back and made some bucks"
 
 
 
Code-Description:
-------------
line 0: Init array of strings and set screen colors, initialize goal-value 

line 1: Increase level, initialize variables (goal, price, time, cash, shares)

line 2: Output variables on screen and calculate random new price

line 3: Get keyboard input and apply to variables. Check for illegal activities and if needed jump to line 7

line 4: Decrease timer and refresh screen clear screen occasionally

line 5: Gameloop (goto line 2) if time is left.

line 6: Else print the player's achievement. Reset goal if necessary.

line 7: Game or day over. Print message and wait for a keypress.

line 6-9: These lines are including data statements for the messages
